package com.cskaoyan.order.remote;

import com.cskaoyan.mall.commons.result.ServiceCallResponse;
import com.cskaoyan.mall.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("duolai-shopping")
public interface ProductApiClient {
    /**
     * 清空指定用户的购物车缓存(用户下完订单之后清理）
     */
    @PostMapping(value = "rpc/cart/items")
    ClearCartItemServiceResponse clearCartItemByUserID(@RequestBody ClearCartItemRequest request);

    /*
        提供给订单服务查询指定商品信息(项目第二阶段才会用到)
     */
    @GetMapping(value = "/rpc/product/detail")
    ServiceCallResponse<ProductDetailDto> getProductDetail(@RequestParam("id") Long id);


    @GetMapping(value = "/rpc/product/status")
    ServiceCallResponse<String> judgeProductExist(@RequestParam("orderId") String orderId);
}
